package utils.ffmpeg;

/**
 * 转码和截图工具
 */
public class ConverVideo {
    //web调用
    public void run(String sourcePath) {
        try {
            // 转码和截图功能开始
            System.out.println("ConverVideo:传入工具类的源视频为:"+ sourcePath);
            //传入path
            ConverVideoUtils converVideoUtils = new ConverVideoUtils(sourcePath);
            //设置转换的格式
            String targetExtension = ".mp4";
            //boolean isDelSourseFile = true;
            //删除源文件
            boolean beginConver = converVideoUtils.beginConver(targetExtension, true);
            System.out.println(beginConver);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

//    //本地测试专用
//    public static void main(String[] args) {
//        ConverVideo c = new ConverVideo();
//        String yuanPATH = "D:/testfile/video/短avi测试.avi";  //本地源视频
//        c.run(yuanPATH);
//    }
}
